package com.oldbook.manage.domain;

import com.oldbook.common.annotation.Excel;
import com.oldbook.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.util.Date;


/**
 * 教材订单对象 tb_order
 *
 * @author Exiaoke
 * @date 2025-02-17
 */
@ApiModel(description = "教材订单对象")
@Data // Lombok annotation to generate all the boilerplate that is normally required for POJOs.
@NoArgsConstructor // Generates a constructor with no parameters.
@AllArgsConstructor // Generates a constructor with 1 parameter for each field in the class.
public class Order extends BaseEntity
        {
            public static final String STATUS_OVERDUE = "2";
            private static final long serialVersionUID = 1L;

    /**
     * 订单ID（主键）
     */
    @ApiModelProperty(value = "订单ID（主键）", name = "orderId", example = "", required = true)
    private Long orderId;

    /**
     * 学生ID（外键，关联 student_info.student_id）
     */
            @Excel(name = "学生ID", readConverterExp = "外=键，关联,s=tudent_info.student_id")
    @ApiModelProperty(value = "学生ID（外键，关联 sysuser.student_id）", name = "studentId", example = "", required = true)
    private String studentId;

    /**
     * 教材ID（外键，关联 textbook.textbook_id）
     */
            @Excel(name = "教材ID", readConverterExp = "外=键，关联,t=extbook.textbook_id")
    @ApiModelProperty(value = "教材ID（外键，关联 textbook.textbook_id）", name = "textbookId", example = "", required = true)
    private Long textbookId;

    /**
     * 借出日期（默认当前时间）
     */
            @Excel(name = "借出日期", readConverterExp = "默=认当前时间")
    @ApiModelProperty(value = "借出日期（默认当前时间）", name = "borrowDate", example = "", required = true)
    private Date borrowDate;

    /**
     * 应还日期（借出日期 + 规则天数）
     */
            @Excel(name = "应还日期", readConverterExp = "借=出日期,+=,规=则天数")
    @ApiModelProperty(value = "应还日期（借出日期 + 规则天数）", name = "dueDate", example = "", required = true)
    private Date dueDate;

    /**
     * 实际归还日期（未归还为NULL）
     */
            @Excel(name = "实际归还日期", readConverterExp = "未=归还为NULL")
    @ApiModelProperty(value = "实际归还日期（未归还为NULL）", name = "returnDate", example = "", required = true)
    private Date returnDate;


    /**
     * 订单状态（0-未归还，1-已归还，2-超期未还）
     */
            @Excel(name = "订单状态", readConverterExp = "0=-未归还，1-已归还，2-超期未还")
    @ApiModelProperty(value = "订单状态（0-未归还，1-已归还，2-超期未还）", name = "status", example = "", required = true)
    private String status;

            @Excel(name = "最后扣分日期", readConverterExp = "0=-未归还，1-已归还，2-超期未还")
    @ApiModelProperty(value = "最后扣分日期", name = "lastDeductionDate", example = "", required = true)
    private LocalDate lastDeductionDate;

    /**
     * 备注
     */
            @Excel(name = "备注")
    @ApiModelProperty(value = "备注", name = "remarks", example = "", required = true)
    private String remarks;


        }